﻿<UserControl x:Class="Quizio.Views.SoloGame.SoloGamePlay"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:mui="http://firstfloorsoftware.com/ModernUI"
             mc:Ignorable="d" 
             xmlns:util="clr-namespace:Quizio.Utilities"
             d:DesignHeight="500" d:DesignWidth="700">
    
    <Grid Style="{StaticResource ContentRoot}">
        <ScrollViewer>
            <StackPanel MinWidth="200">
                <TextBlock  Style="{StaticResource Heading2}" HorizontalAlignment="Right" Margin="0,0,0,20">
                            <Run Text="{Binding QuestionsDone}"></Run>
                            <Run Text="/"></Run>
                            <Run Text="{Binding QuestionsRemaining}"></Run>
                </TextBlock>
                <TextBlock HorizontalAlignment="Left" Margin="0,0,10,-10">
                        <Run Text="Verbleibende Zeit: "></Run>
                        <Run Text="{Binding TimerTickCountDown}"></Run>
                </TextBlock>
                <ProgressBar HorizontalAlignment="Right" Minimum="0" Maximum="10" Value="{Binding TimerTickCount}" Width="550" Height="10" IsIndeterminate="False" Margin="0,0,-10,0" />
               
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="Auto"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="700"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.Column="0" Grid.Row="1">
                        <TextBlock TextWrapping="Wrap" Style="{StaticResource Heading2}" HorizontalAlignment="Center" Margin="0,20,0,0">
                            <Run Text="{Binding CurrentQuestion.QuestionString}"></Run>
                        </TextBlock>
                        <TextBlock  Margin="0,0,0,10" FontStyle="Italic" HorizontalAlignment="Center">
                            <Run Text="{Binding CurrentQuestion.Hint}"></Run>
                        </TextBlock>
                    </StackPanel>
                    <StackPanel Grid.Column="0" Grid.Row="2" Margin="0,20,0,0">
                        <ItemsControl x:Name="Answers" ItemsSource="{Binding CurrentQuestion.Answers}">
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <mui:ModernButton CommandParameter="{Binding AnswerText}" Command="{Binding ElementName=Answers, Path=DataContext.NextQuestion}" 
                                                      Content="{Binding AnswerText}" Margin="100,20,0,0" HorizontalAlignment="Left" 
                                                      EllipseDiameter="48" EllipseStrokeThickness="2" IconWidth="30" IconHeight="30"
                                                      IconData="F1 M 23.7501,33.25L 34.8334,44.3333L 52.2499,22.1668L 56.9999,26.9168L 34.8334,53.8333L 19.0001,38L 23.7501,33.25 Z"
                                                      HorizontalContentAlignment="Center">
                                    </mui:ModernButton>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                    </StackPanel>
                </Grid>
            </StackPanel>
        </ScrollViewer>
    </Grid>
</UserControl>